]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: don't close the tray when interacting with the right click menu
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 30 Nov 2012 15:14:50 +0000 (16:14 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 30 Nov 2012 17:43:57 +0000 (18:43 +0100)
If the chosen action is not open, the tray should not be closed, to
let the user further interact with it (for example to mute or remove
more sources)

https://bugzilla.gnome.org/show_bug.cgi?id=689296

js/ui/components/telepathyClient.js
js/ui/messageTray.js

index ddceb345d9f5265e70f7df41aea8397fc8867e4a..b3a303ab0ffa692cdf95268ad2482e5c092992e8 100644 (file)
@@ -478,7 +478,7 @@ const ChatSource = new Lang.Class({
         }));
         item.connect('activate', Lang.bind(this, function() {
             this.setMuted(!this.isMuted);
-            this.emit('done-displaying-content');
+            this.emit('done-displaying-content', false);
         }));
         rightClickMenu.add(item.actor);
         return rightClickMenu;
index 35665bd5aa35143fe3957752dc8a8062ca4aee01..6fba5dd6dcb955f6c6667c11ce89b8ecf248e9b8 100644 (file)
@@ -1088,14 +1088,14 @@ const Source = new Lang.Class({
         item = new PopupMenu.PopupMenuItem(_("Open"));
         item.connect('activate', Lang.bind(this, function() {
             this.open();
-            this.emit('done-displaying-content');
+            this.emit('done-displaying-content', true);
         }));
         rightClickMenu.add(item.actor);
 
         item = new PopupMenu.PopupMenuItem(_("Remove"));
         item.connect('activate', Lang.bind(this, function() {
             this.destroy();
-            this.emit('done-displaying-content');
+            this.emit('done-displaying-content', false);
         }));
         rightClickMenu.add(item.actor);
         return rightClickMenu;
@@ -1341,7 +1341,7 @@ const SummaryItem = new Lang.Class({
     },
 
     _notificationDoneDisplaying: function() {
-        this.source.emit('done-displaying-content');
+        this.source.emit('done-displaying-content', true);
     },
 
     _notificationDestroyed: function(notification) {
@@ -2454,12 +2454,21 @@ const MessageTray = new Lang.Class({
                     });
     },
 
+    _onSourceDoneDisplayingContent: function(source, closeTray) {
+        if (closeTray) {
+            this._escapeTray();
+        } else {
+            this._setClickedSummaryItem(null);
+            this._updateState();
+        }
+    },
+
     _showSummaryBoxPointer: function() {
         this._summaryBoxPointerItem = this._clickedSummaryItem;
         this._summaryBoxPointerContentUpdatedId = this._summaryBoxPointerItem.connect('content-updated',
                                                                                       Lang.bind(this, this._onSummaryBoxPointerContentUpdated));
         this._sourceDoneDisplayingId = this._summaryBoxPointerItem.source.connect('done-displaying-content',
-                                                                                  Lang.bind(this, this._escapeTray));
+                                                                                  Lang.bind(this, this._onSourceDoneDisplayingContent));
 
         let hasRightClickMenu = this._summaryBoxPointerItem.rightClickMenu != null;
         if (this._clickedSummaryItemMouseButton == 1 || !hasRightClickMenu) {